﻿using System.Configuration;

namespace ALinq.BBS.Common.Config
{
    public abstract class ConfigurationElementCollection<T> : ConfigurationElementCollection
        where T : ConfigurationElement,new()
    {
        public T this[int index]
        {
            get
            {
                return (T) base.BaseGet(index);
            }
        }

        public T this[object key]
        {
            get
            {
                return (T) BaseGet(key);
            }
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new T();
        }
    }
}